﻿using System;
using Zeus.Thunder.Core;
using CsharpTrainer.MongoDB.Model;
using CsharpTrainer.MongoDB.DAL;

namespace SharpTrainer.MongoDB
{
    class MongoQueryLikeTest : ITestCase
    {
        public void Run()
        {
            MongodbHelper<CsharpTrainer.MongoDB.Model.Person> helper = new MongodbHelper<CsharpTrainer.MongoDB.Model.Person>();

            int pagecount;

            //获取名字里面带9的人数
            var persons = helper.List(1, 20, i => i.Name.Contains("9"), out pagecount);

            foreach (CsharpTrainer.MongoDB.Model.Person person in persons)
                Console.WriteLine(person);
        }
    }
}
